package com.yixing.demo.service;

import com.yixing.demo.mapper.UserMapper;
import com.yixing.demo.model.User;
import org.springframework.stereotype.Service;

import javax.annotation.Resource;

@Service
public class UserService {
    @Resource
    UserMapper userMapper;
    public User login(String username) {
       return userMapper.login(username);
    }

    public void register(User user) {
        userMapper.register(user);
    }

    public Integer uploadAvatar(String localFilePath, Integer userId) {
        return userMapper.uploadAvatar(localFilePath, userId);
    }

    public String selectAvatar(int userId) {
        return userMapper.selectAvatar(userId);
    }

    public String selectAvatarByUsername(String username) {
        return userMapper.selectAvatarByUsername(username);
    }
}
